<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
    <title>BendTech: <?= $h['name_company'] ?></title>

    <?php include_once('PP.php'); ?>
    <?php include_once 'PPEntry.php'; ?>
    <?php
      // Get/create the entry object 
      $entry = PPEntry::get_current_entry();
      $h = $entry->htmlFields();
    ?>
  </head>

  <body id="pp_detail">
    <?php include_once('bendtech-header.php') ?>
    <?php if ($entry->isNew()) {
      header('Status: 404 Not Found');
      ?>
      <p>Entry does not exist</p>
      <ul class="pp_nav">
        <li><a href="<?= PP::getUrl('index') ?>">Back to Index</a></li>
      </ul>
    <?php } else { ?>
      <img src="<?= $entry->getUrl('image') ?>" />
      <h2><?= $h['name_company'] ?></h2>

      <div class="description"><?= $h['description'] ?></div>

      <dl class="contact_info">
        <?php if ($h['email']) { ?>
          <dt class="label">email</dt>
          <dd class="email"><a href="mailto:<?= $h['email'] ?>"><?= $h['email'] ?></a></dd>
        <? } ?>
        <?php if ($h['url']) { ?>
          <dt class="label">www</dt>
          <dd class="url"><a rel="nofollow" href="<?= $h['url'] ?>"><?= $h['url'] ?></a></dd>
        <? } ?>
        <?php if ($h['phone']) { ?>
          <dt class="label">phone</dt>
          <dd class="phone"><?= $h['phone'] ?></dd>
        <? } ?>
        <?php if ($h['address']) { ?>
          <dt class="label">address</dt>
          <dd class="address"><?= $h['address'] ?></dd>
        <? } ?>
      </dl>

      <ul class="pp_nav">
        <li><?= PP::getLink('index', 'Back to index') ?></li>
        <li><?= $entry->getLink('edit', 'Edit this entry') ?></li>
      </ul>
    <?php } ?>
    <?php include_once('bendtech-footer.php') ?>
  </body>
</html>
<?php PP::disconnect() ?>
